<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>    
    <div id="app">       
        <book >
            <template v-slot="obj" >
                <div>
                    <p>性别：{{obj.sex}}</p>  
                </div>
            </template>
            
            <template v-slot:s1="obj" >
                <div>
                    <p>价格：{{obj.price}}</p>  
                </div>
            </template>
        </book>
    </div>
    <script src="./js/vue.global.js"></script>
    <script>
        let book = {     
            template:`
                <div>
                    <p>我是上p</p>
                    <slot :sex="23"></slot> 
                    <p>我是中p</p>
                    <slot name="s1" :price="51.2"></slot>
                    <p>我是下p</p>
                </div>   
            `,
            data(){
                return {
                    name:"aaa",
                    sex:"男"
                }
            }           
        }
       
        let app = Vue.createApp({
            components:{
                book
            }                  
        });
      
        app.mount("#app");

    </script>
</body>
</html>